#include <bits/stdc++.h>
// 2025/07/23
// tag:
// Author: Forever
using namespace std;
using int64 = int64_t;
#define int long long
#define pow2(x) (x) * (x)
struct point {
    int x, y;
    bool operator<(const point& a) const
    {
        return x < a.x || (x == a.x && y < a.y);
    }
} p[50001];

int cross(int x, int y, int z)
{
    return (p[y].x - p[x].x) * (p[z].y - p[x].y) - (p[y].y - p[x].y) * (p[z].x - p[x].x);
}

int dis(int x, int y)
{
    return pow2(p[x].x - p[y].x) + pow2(p[x].y - p[y].y);
}

int n, stk[50001], top;
void hull()
{
    sort(p + 1, p + n + 1);
    for (int i = 1; i <= n; i++) {
        while (top >= 2 && cross(stk[top - 1], stk[top], i) <= 0)
            top--;
        stk[++top] = i;
    }
    int tmp = top;
    for (int i = n - 1; i >= 1; i--) {
        while (top > tmp && cross(stk[top - 1], stk[top], i) <= 0)
            top--;
        stk[++top] = i;
    }
    top--;
}

int R()
{
    int ans = 0, j = 2;
    while (cross(stk[1], stk[2], stk[j]) < cross(stk[1], stk[2], stk[j % top + 1]))
        j = j % top + 1;
    for (int i = 1; i <= top; i++) {
        while (cross(stk[i], stk[i % top + 1], stk[j]) < cross(stk[i], stk[i % top + 1], stk[j % top + 1]))
            j = j % top + 1;
        ans = max({ ans, dis(stk[i], stk[j]), dis(stk[i % top + 1], stk[j]) });
    }
    return ans;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> p[i].x >> p[i].y;
    if (n == 2) {
        cout << dis(1, 2) << endl;
        return 0;
    }
    hull();
    cout << R() << endl;
    return 0;
}